package com.frx.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class U1235p2 {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine().trim());
        System.out.println(isTwo(n));
    }

    public static int isTwo(int num){
        if(num < 2){
            return 0;
        }
        if(num == 2){
            return 1;
        }else if(num % 2 == 0){
            return isTwo(num / 2);
        }else{
            return 0;
        }

    }

}
